<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript" src="jquery.min.js">

		</script>
	</head>
	<body>
		<div class="grandfather">
			<div class="father">
				<div class="son">
					儿子
				</div>
			</div>
		</div>
		<div class="nav">
			<p>pp</p>
			<div>
				<p>你个p</p>
			</div>
		</div>
		<script type="text/javascript">
			$(function() {
				//1.父
				console.dir($('.son').parent());
				//2.子
				//亲儿子
				// $(".nav").children('p').css('background', 'green');
				//儿子和孙子都有
				$(".nav").find('p').css('background', 'green');


			})
		</script>
	</body>
</html>
